home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / UNIXTOOL / GNU / PERL / PERL5SRC.ZIP / !Perl / sys / h / Stat
Text File  |  1995-06-26  |  2KB  |  55 lines

  1. /* H.Stat: Header file for stat call (Specialised version for Perl) */
  2. #ifndef __sys_stat_h
  3. #define __sys_stat_h
  4. #endif
  5.  
  6. #include <time.h>
  7.  
  8.  
  9. struct stat
  10. {
  11.     unsigned int    st_dev;
  12.     unsigned int    st_ino;
  13.         unsigned short  st_mode;        /* mode bits */
  14.         short           st_nlink;       /* number of links to file */
  15.         short           st_uid;         /* user id of owner ( = 0 ) */
  16.         short           st_gid;         /* group id of owner ( = 0 ) */
  17.         unsigned int    st_size;        /* file size in characters */
  18.         time_t          st_mtime;       /* time file last written or created */
  19.  
  20.         int        st_type;        /* file type (file/directory) */
  21.         int        st_ftype;       /* file type (-1 if unstamped) */
  22.         int        st_load;    /* load address */
  23.         int        st_exec;    /* execution address */
  24.         int        st_length;    /* file size in bytes */
  25.         int        st_attr;    /* file attributes */
  26.         double        st_time;        /* time stamp (0 if unstamped) */
  27.         time_t        st_utime;    /* time stamp in Unix format */
  28. };
  29.  
  30. /* File types */
  31.  
  32. #define T_FILE        1        /* Plain file */
  33. #define T_DIRECTORY    2        /* Directory */
  34.  
  35. /* File attribute bits */
  36. /* Parts of st_mode field */
  37.  
  38. #define S_IFMT          0170000         /* type of file */
  39. #define S_IFDIR           0040000         /* directory */
  40. #define S_IFREG           0100000         /* regular */
  41. #define S_IREAD         0000400         /* read permission, owner */
  42. #define S_IWRITE        0000200         /* write permission, owner */
  43. #define S_IEXEC         0000100         /* execute permission, owner */
  44. #define S_IFCHR        0000000
  45.  
  46. /* Parts of st_attribs field */
  47.  
  48. #define S_READ        0x01        /* Read access for user */
  49. #define S_WRITE        0x02        /* Write access for user */
  50. #define S_LOCK        0x08        /* File is locked */
  51. #define S_PREAD        0x10        /* Public read access */
  52. #define S_PWRITE    0x20        /* Public write access */
  53.  
  54. extern int stat (char *name, struct stat *buf);
  55.